package com.winit.openapi.wop.inbound.constant;

import org.apache.commons.lang.StringUtils;

public final class WHInboundConstant {

    /**
     * 入库单类型常量
     * 
     * @version <pre>
     * Author	Version		Date		Changes
     * minghao.deng 	1.0  		2016年9月28日 	Created
     *
     * </pre>
     * @since 1.
     */
    public enum InboundOrderType {
        SD("SD", "标准海外仓入库"), DW("DW", "直发海外验入库"), DI("DI", "直发国内验入库"), LI("LI", "本地仓入库");

        private String code;
        private String description;

        private InboundOrderType(String code, String description){
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public static boolean isValidOrderType(String code) {
            if (StringUtils.isEmpty(code)) {
                return false;
            }
            for (InboundOrderType item : InboundOrderType.values()) {
                if (code.equals(item.getCode())) {
                    return true;
                }

            }
            return false;
        }
    }

    /**
     * 头程类型常量
     * 
     * @version <pre>
     * Author	Version		Date		Changes
     * minghao.deng 	1.0  		2016年9月28日 	Created
     *
     * </pre>
     * @since 1.
     */
    public enum FirstLegType {

        WC("WC", "Winit承运"), NS("NS", "直发");

        private String code;
        private String description;

        private FirstLegType(String code, String description){
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public static boolean isValidOrderType(String code) {
            if (StringUtils.isEmpty(code)) {
                return false;
            }
            for (FirstLegType item : FirstLegType.values()) {
                if (code.equals(item.getCode())) {
                    return true;
                }

            }
            return false;
        }
    }

    /**
     * 仓库类型常量
     * 
     * @version <pre>
     * Author   Version     Date        Changes
     * minghao.deng     1.0         2016年9月28日  Created
     *
     * </pre>
     * @since 1.
     */
    public enum WarehouseType {

        DEST("DEST", "目的仓"), INSJ("INSJ", "验货仓");

        private String code;
        private String description;

        private WarehouseType(String code, String description){
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public static boolean isValidWarehouseType(String code) {
            if (StringUtils.isEmpty(code)) {
                return false;
            }
            for (WarehouseType item : WarehouseType.values()) {
                if (code.equals(item.getCode())) {
                    return true;
                }

            }
            return false;
        }
    }
    
    
    /**
     * 进出口商类型常量
     * 
     * @version <pre>
     * Author   Version     Date        Changes
     * minghao.deng     1.0         2016年9月28日  Created
     *
     * </pre>
     * @since 1.
     */
    public enum VendorType {

        IOR("IOR", "进口商"), EOR("EOR", "出口商");

        private String code;
        private String description;

        private VendorType(String code, String description){
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public static boolean isValidVendorType(String code) {
            if (StringUtils.isEmpty(code)) {
                return false;
            }
            for (VendorType item : VendorType.values()) {
                if (code.equals(item.getCode())) {
                    return true;
                }

            }
            return false;
        }
    }

    /**
     * 仓库类型常量
     * 
     * @version <pre>
     * Author   Version     Date        Changes
     * minghao.deng     1.0         2016年9月28日  Created
     *
     * </pre>
     * @since 1.
     */
    public enum ProductType {

        OW0101("OW0101", "标准海外仓入库"), OW0102("OW0102", "直发国内验入库"), OW0103("OW0103", "直发海外验入库");

        private String code;
        private String description;

        private ProductType(String code, String description){
            this.code = code;
            this.description = description;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public static boolean isValidOrderType(String code) {
            if (StringUtils.isEmpty(code)) {
                return false;
            }
            for (ProductType item : ProductType.values()) {
                if (code.equals(item.getCode())) {
                    return true;
                }

            }
            return false;
        }
    }

}
